package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Select;

public interface UserInfoMapper extends BaseMapper<UserInfo> {

    //需要我们自己定义一个多表联查userInfo数据的方法
    @Select(
            "SELECT * FROM tb_user_info WHERE id IN(SELECT black_user_id FROM tb_black_list WHERE user_id=#{userId})"
    )
    IPage<UserInfo>findBlackList(Page<UserInfo> page, Long userId);
}
